home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / TFC014.422 < prev    next >
Text File  |  1993-03-01  |  17KB  |  486 lines

  1. 2TFC014.422 1The Ultimate Qscan Configuration Mod
  2. The Flying Chicken [SysOp] #1 @12456
  3. 3Saturday, February 27, 1993  1 8:12 pm
  4. TFC014.MOD - Newuser Config Qscan
  5. Author: The Flying Chicken 1@12456 (WWIVLink) 1@2456 (WWIVNet) 1@2456 (IceNet)
  6. Source: WWIV 4.20, 4.21 (NOT 4.21a), 4.22
  7. Version: 1.3
  8.  
  9.     /* This file is only for version WWIV 4.22 users, if you are
  10.        running 4.20 or 4.21, close this file and open TFC014.MOD!  */
  11.  
  12.  
  13.     If you are using WOMR or another off-line file reader, you'll LOVE
  14.     this mod.  And if not, you'll love it anyway!  This mod is really
  15.     for the users, so that they can very easily determine what subs they
  16.     do and don't want to scan everyday.  It allows new users to
  17.     configure their Qscan automatically, and greatly improves the look
  18.     and feel of the Configure Qscan option in the defaults section.  For
  19.     ANSI folks, the sublisting is on the screen all the time, and when
  20.     you add or remove subs to your scan, it just changes the '*' on the
  21.     screen.
  22.  
  23.     When configuring your Qscan, the mod will will also show you short
  24.     descriptions of each sub, if you want them, so that you can decide
  25.     if the sub is for you or not.  An added feature, you can decide
  26.     whether or not you want users to be able to remove directory 1 from
  27.     their scan!  On my system, this is my SysOp Information sub, and I
  28.     want everyone to read it, so I don't let them remove it from their
  29.     Qscan.
  30.  
  31.     A final note about the mod.  This mod requires quite a bit of typing
  32.     on your part.  The mod itself is rather simple, all things
  33.     considered, but in order to make use of it, you have to type up a
  34.     description file for all of your subs.  This can take a bit of work,
  35.     but if done with a little bit of TLC, you can really improve the
  36.     user-friendliness of your system.  Give yourself plenty of time,
  37.     and you'll like the results that much more.
  38.  
  39.     v1.3  - Upgrade for 4.22.  Allowed long-distance new users to use
  40.             the regular qScan config, so they wouldn't have to use
  41.             as much time on-line to set subs up.  Area code is checked
  42.             against system phone number's area code to determine if 
  43.             caller is LD or not.
  44.     v1.2  - Redone by Sky 2@17470.  Upgraded to 4.21 by Sky, who also
  45.             fixed some bugs in the previous versions.  MANY Thanks
  46.             to Sky for the upgrade.
  47.     v1.0  - Initial Release
  48.  
  49.  
  50.     Before using this or any mod, back up your source !!!!!
  51.  
  52.                 PKZIP source *.c *.h *.mak
  53.  
  54.     1. Load up FCNS.H.  Search for /* File: defaults.c */ and make
  55.        the following changes.
  56.  
  57. void print_cur_stat();
  58. char *cn(char c);
  59. char *describe(char col);
  60. void color_list();
  61. void change_colors();
  62. int l_config_qscan(int *i, int *i5, int *i6);                   /* CHANGE */
  63. void config_qscan();
  64. void list_macro(unsigned char *s);
  65.  
  66.  
  67.     2. Now search for /* File: newuser.c */, and make these changes.
  68.  
  69. void input_age(userrec *u);
  70. void input_comptype();
  71. void input_screensize();
  72. void input_pw();
  73. void input_ansistat();
  74. void newuser();
  75. void printsubmsg(int i);                    /* ADD */
  76. void set_subs();                            /* ADD */
  77.  
  78.  
  79.     3. Save FCNS.H and load NEWUSER.C.  Add the following two functions
  80.        right before the int check_name() procedure, at the beginning
  81.        of the file.  There is a note in the second procedure about
  82.        being able to remove directory 1 from the scan, check it out!
  83.  
  84. void printsubmsg(int i)                               /* ADD VOID */
  85. {
  86.   char s[81],s1[81];
  87.  
  88.   if ((thisuser.sysstatus & (sysstatus_color | sysstatus_ansi))
  89.       == (sysstatus_color | sysstatus_ansi)) {
  90.     sprintf(s1,"SUBS%u.ANS", i);
  91.     sprintf(s,"%s%s",syscfg.gfilesdir,s1);
  92.     if (exist(s)) {
  93.       printfile(s1);
  94.       return;
  95.     }
  96.   }
  97.   sprintf(s1,"SUBS%u.MSG", i);
  98.   sprintf(s,"%s%s",syscfg.gfilesdir,s1);
  99.   if (exist(s)) {
  100.     printfile(s1);
  101.     return;
  102.   } else {
  103.     nl();
  104.     prt(2,"No description for this sub.  Notify the SysOp.");
  105.     nl();
  106.     return;
  107.   }
  108. }
  109.  
  110. void set_subs()                        /* ADD ENTIRE FUNCTION */
  111. {
  112.   int     i,quick;
  113.   char    s[81];
  114.  
  115.   quick=0;
  116.  
  117.   if (strncmp(thisuser.dataphone,syscfg.systemphone,3))
  118.     quick=1;
  119.  
  120.   outchr(12);
  121.   nl();
  122.   prt(2,"Here at ");
  123.   prt(2,syscfg.systemname);
  124.   prt(2,", I have quite a few messages bases, each with\r\n");
  125.   prt(2,"a different topic of discussion.  However, you may not want\r\n");
  126.   if (quick) {
  127.     prt(2,"to read all of them.  I am going to take you to the Qscan\r\n");
  128.     prt(2,"configuration screen.  Set up the subs you want to scan\r\n");
  129.     prt(2,"when reading messages.\r\n");
  130.   } else {
  131.     prt(2,"to read all of them.  So now we will go through each of my\r\n");
  132.     prt(2,"message bases.  You will be shown a short description of the \r\n");
  133.     prt(2,"sub, and then you will be asked if you would like to have\r\n");
  134.     prt(2,"access to it.\r\n");
  135.   }
  136.   pausescr();
  137.   checkhangup();
  138.   if (quick) {
  139.     if (hangup)
  140.       return;
  141.     config_qscan();
  142.   } else {
  143.     for (i=0; (!hangup) && (i<num_subs) && (usub[i].subnum!=-1); i++) {
  144.       outchr(12);
  145.       sprintf(s,"2Sub number 3%d: 1%s",(i+1),subboards[usub[i].subnum].name);
  146.       pl(s);
  147.       nl();
  148.       printsubmsg(usub[i].subnum+1);
  149.       nl();
  150.  
  151. /***** If you want users to be able to remove directory 1 from their
  152.        scan, remove the next 5 lines, and ONLY five lines !!!         ******/
  153.       if (i==0) {
  154.         prt(1,"All users are required to have access to this sub.");
  155.         nl();
  156.         pausescr();
  157.       } else
  158.         {
  159.           prt(2,"Would you like access to this message base? ");
  160.           if (!ny())
  161.             qsc_q[usub[i].subnum/32] ^= (1L<<(usub[i].subnum%32));
  162.           nl();
  163.         }
  164.     }
  165.   }
  166.  
  167. }
  168.  
  169.  
  170.     4. Search for newuser() and go to step 5.
  171.  
  172.     5. Scroll down farther in newuser() and make these changes.
  173.  
  174.     changedsl();
  175.     checkit=0;
  176.     set_subs();                                 /* ADD */
  177.     if (incom) {
  178.       if (printfile("FEEDBACK"))
  179.         sl1(0,"#Aborted FEEDBACK.MSG");
  180.       sprintf(irt,"Validation Feedback (%d slots left)",syscfg.maxusers-status.
  181. users);
  182.       irt_name[0]=0;
  183.       email(1,0,1,0);
  184.     }
  185.  
  186.  
  187.     6. Save NEWUSER.C and load up DEFAULTS.C.  Search for l_config_qscan()
  188.        and replace it with the following function.
  189.  
  190. int l_config_qscan(int *i, int *i5, int *i6)     /* REPLACE ENTIRE VOID */
  191. {
  192.   char s[81];
  193.   int i2,i3,i4;
  194.  
  195.   outchr(12);
  196.   prt(2,"Sub #   Scan?   Sub Name");nl();
  197.   prt(2,"-----   -----   ----------------------------------------");nl();
  198.   i2=0;
  199.   i3=*i5;
  200.  
  201.   do {
  202.     if (usub[i3].subnum==-1) {
  203.       prt(1,"-- End of list --");
  204.       nl();
  205.     } else {
  206.       i4=usub[i3].subnum;
  207.       sprintf(s,"1  %-2.2s      %c     %s",
  208.         usub[i3].keys,
  209.         (qsc_q[i4/32] & (1L << (i4 % 32))) ? '*' : ' ',
  210.         subboards[i4].name);
  211.       pl(s);
  212.       if (i2==0) *i6 = i4;
  213.       i3++;
  214.       i2++;
  215.     }
  216.   } while ((usub[i3].subnum<num_subs) && (i2<15) && (usub[i3].subnum!=-1));
  217.   *i=usub[i3].subnum;
  218.   if (usub[i3].subnum==-1) *i=num_subs;
  219.   *i5=i3;
  220.   return(i2);
  221.  
  222. }
  223.  
  224.  
  225.     7. Now replace the next function, config_qscan(), as well.  Make
  226.        a note of the comment in the procedure, if you want the user
  227.        to be able to remove directory 1 from their scan.
  228.  
  229. void config_qscan()                          /* REPLACE ENTIRE VOID */
  230. {
  231.   char s[81],ss[81],s1;
  232.   int i,i2,i3,i4,i5,i6,done,more,ok;
  233.  
  234.   i=i4=i5=i6=done=s[0]=ss[0]=0;
  235.   do {
  236.     more=0;
  237.     i4=l_config_qscan(&i, &i5, &i6);
  238.     if (i5>num_subs)
  239.         done=1;
  240.     else
  241.         do {
  242.           if (okansi())
  243.           goxy(1,19);
  244.           else
  245.           nl();
  246.         prt(2,"Enter number of sub to toggle, 'M' to list more,\r\n");
  247.         prt(2,"'L' to relist, 'D' for sub description, or 'Q' to quit.\r\n");
  248.           helpl=7;
  249.           ok=0;
  250.           do {
  251.           if (okansi()) {
  252.             goxy(1,21);
  253.             outstr("\033[K");
  254.           }
  255.           strcpy(s,mmkey(0));
  256.           if (s[0]) {
  257.             for (i2=0;i2<num_subs;i2++)
  258.               if (strcmp(usub[i2].keys,s)==0) {
  259.                 if (((usub[i2].subnum+1) <= i) && (usub[i2].subnum+1 > i6))
  260.                   ok=1;
  261.  
  262. /***** If you want users to be able to remove directory 1 from
  263.        their Qscan, remove the next two lines, and two lines only!! *****/
  264.                 if (usub[i2].subnum==0)
  265.                   ok=0;
  266.               }
  267.             if ((strcmp(s,"Q")==0) || (strcmp(s,"D")==0) ||
  268.               (strcmp(s,"L")==0) || (strcmp(s,"M")==0))
  269.                 ok=1;
  270.           }
  271.         } while (!ok);
  272.         if (s[0])
  273.           for (i2=0; i2<num_subs; i2++) {
  274.             if (strcmp(usub[i2].keys,s)==0) {
  275.               qsc_q[usub[i2].subnum/32] ^= (1L<<(usub[i2].subnum%32));
  276.               s1=(qsc_q[usub[i2].subnum/32]&(1L<<(usub[i2].subnum%32)))?'*':' ';
  277.               if (okansi()) {
  278.                 i3=(i2 % 15) + 3;
  279.                 goxy(11,i3);
  280.                 ansic(2);
  281.                 outchr(s1);
  282.               } else
  283.                 strcpy(s,"L");
  284.             }
  285.           }
  286.           if (strcmp(s,"Q")==0)
  287.           done=1;
  288.           if (strcmp(s,"L")==0) {
  289.           i5-=i4;
  290.           more=1;
  291.         }
  292.         if (strcmp(s,"M")==0)
  293.           more=1;
  294.         if (strcmp(s,"D")==0) {
  295.           nl();
  296.           prt(2,"Which sub do you want a description of? ");
  297.           strcpy(ss,mmkey(0));
  298.           if (ss[0])
  299.             for (i2=0; i2<num_subs; i2++) {
  300.               if (strcmp(usub[i2].keys,ss)==0) {
  301.                 if (okansi()) {
  302.                   for(i3=18;i3<25;i3++) {
  303.                     goxy(1,i3);
  304.                     outstr("\033[K");
  305.                   }
  306.                   goxy(1,18);
  307.                 } else
  308.                   nl();
  309.                 printsubmsg(usub[i2].subnum+1);
  310.                 pausescr();
  311.                 if (okansi()) {
  312.                   for(i3=18;i3<25;i3++) {
  313.                     goxy(1,i3);
  314.                     outstr("\033[K");
  315.                   }
  316.                 } else {
  317.                   i-=i4;
  318.                   more=1;
  319.                 }
  320.               }
  321.             }
  322.         }
  323.       } while ((!done) && (!hangup) && (!more));
  324.   } while ((!done) && (!hangup));
  325. }
  326.  
  327.  
  328.  
  329.     8. Now we need to make some changes to subedit to rename and
  330.        delete the description files when inserting and deleting subs.
  331.        Load up SUBEDIT and search for void insert_sub.  Make the
  332.        changes below.
  333.  
  334.   subboardrec r;
  335.   int i,i1,i2,nu;
  336.   unsigned long *qsc, *qsc_n, *qsc_q, *qsc_p, m1, m2, m3;
  337.   char s[81],s1[81];                                    /* ADD */
  338.  
  339.   for (i=num_subs-1; i>=n; i--) {
  340.     subboards[i+1]=subboards[i];
  341.     sub_dates[i+1]=sub_dates[i];
  342.     xsubs[i+1]=xsub[i];
  343.     sprintf(s,"%sSUBS%u.ANS",syscfg.gfilesdir,i+1);     /* ADD */
  344.     sprintf(s1,"%sSUBS%u.ANS",syscfg.gfilesdir,i+2);    /* ADD */
  345.     if (exist(s))                                       /* ADD */
  346.         rename(s,s1);                                   /* ADD */
  347.     sprintf(s,"%sSUBS%u.MSG",syscfg.gfilesdir,i+1);     /* ADD */
  348.     sprintf(s1,"%sSUBS%u.MSG",syscfg.gfilesdir,i+2);    /* ADD */
  349.     if (exist(s))                                       /* ADD */
  350.         rename(s,s1);                                   /* ADD */
  351.   }
  352.   strcpy(r.name,"** NEW SUB **");
  353.  
  354.  
  355.     9. Go to step 10.
  356.  
  357.     10. Scroll to the end of the insert_sub procedure, and make these
  358.         changes.  Pay attention to the comments in the following
  359.         code.
  360.  
  361.       u.qscn=(u.qscn & l1) | ((u.qscn << 1) & l2) | l3;
  362.       write_user(i,&u);
  363.     }
  364.   }
  365.   modify_sub(n);
  366.   nl();                                                 /* ADD */
  367.                                                         /* ADD NEXT LINE */
  368.   npr("2Don't forget to create a SUBS%u.ANS or SUBS%u.MSG file\r\n",n+1,n+1);
  369.   npr("2for this sub in your GFILES directory!\r\n");  /* ADD */
  370.   nl();                                                 /* ADD */
  371.  
  372. }
  373.  
  374.  
  375.     11. Now search for void delete_sub, and make these changes.
  376.  
  377.   int i,i1,i2,nu;
  378.   unsigned long *qsc, *qsc_n, *qsc_q, *qsc_p, m2, m3;
  379.   char s1[81],s2[81];                                   /* ADD */
  380.  
  381.   while (xsubs[n].num_nets)
  382.     sub_xtr_del(n, 0, 1);
  383.   if ((xsubs[n].nets) && (xsubs[n].flags & XTRA_MALLOCED))
  384.     farfree(xsubs[n].nets);
  385.  
  386.   for (i=n; i<num_subs; i++) {
  387.     subboards[i]=subboards[i+1];
  388.     sub_dates[i]=sub_dates[i+1];
  389.     xsubs[i]=xsubs[i+1];
  390.     sprintf(s1,"%sSUBS%u.ANS",syscfg.gfilesdir,i+2);    /* ADD */
  391.     sprintf(s2,"%sSUBS%u.ANS",syscfg.gfilesdir,i+1);    /* ADD */
  392.     if (exist(s2))                                      /* ADD */
  393.         unlink(s2);                                     /* ADD */
  394.     if (exist(s1))                                      /* ADD */
  395.         rename(s1,s2);                                  /* ADD */
  396.     sprintf(s1,"%sSUBS%u.MSG",syscfg.gfilesdir,i+2);    /* ADD */
  397.     sprintf(s2,"%sSUBS%u.MSG",syscfg.gfilesdir,i+1);    /* ADD */
  398.     if (exist(s2))                                      /* ADD */
  399.         unlink(s2);                                     /* ADD */
  400.     if (exist(s1))                                      /* ADD */
  401.         rename(s1,s2);                                  /* ADD */
  402.   }
  403.   --num_subs;
  404.   read_user(1,&u);
  405.  
  406.  
  407.     12. Save SUBEDIT.C.  Now comes the fun part.  You need to create
  408.         some files that contain the descriptions of all of your subs.
  409.         Each directory has it's own description file, and it is called
  410.         SUBSn.ANS and SUBSn.MSG.  You don't have to create the .ANS
  411.         files it will look for .MSG if the .ANS file doesn't exist.  The
  412.         'n' in the file name is the directory number.  Note that the
  413.         numbering starts from 1, not 0. ,i.e. for directory number 0,
  414.         create a SUBS1.ANS or SUBS1.MSG file (or both).  These files go
  415.         into your GFILES directory.
  416.  
  417.         Sky here:  One other note here:  YOU MUST make one of these
  418.                    files for EVERY sub you have.  Make the number one
  419.                    higher that what you see in //BOARDEDIT, and use
  420.                    BOARDEDIT and not * (sublist), because if you are
  421.                    like me there are some subs you don't have in your
  422.                    scan!
  423.  
  424.         Here's an example of my first one, SUBS1.MSG.
  425.  
  426.         This sub is used for system information.  All users will have
  427.         access to this sub, but only SysOps will be able to post here.
  428.  
  429.  
  430.         Some other notes about these files, THEY MUST NOT BE LONGER
  431.         THAN 5 LINES!  If you have something on the sixth line,
  432.         the qscan config in the defaults section won't come out as
  433.         pretty as it does now.  The reason for this is I allow five
  434.         lines on the screen for the description.  Five lines should
  435.         be enough anyway, these are just short descriptions.  If you
  436.         want sub rules and such, post them as permanent messages.
  437.  
  438.  
  439.  
  440.  
  441.     DISCLAIMER:  I make no guarantees with this mod whatsoever.
  442.     Your installation of the mod is your acceptance of any
  443.     damages caused to your hardware or software, incendental or
  444.     otherwise.
  445.  
  446.     The mod was tested with the versions of WWIV mentioned in
  447.     this file. If the mod does NOT work for you, e-mail one of
  448.     the addresses above, and tell me EXACTLY what you did, what
  449.     the screen said, and what you did to try to fix it, and I'll
  450.     do what I can to help you out.
  451.  
  452.     PLEASE REPORT ANY BUGS TO ME AT THE ABOVE ADDRESS !!!!!!!
  453.     Any other comments, suggestions, hints, things I missed,
  454.     requests for new mods, and general "Thank you!"s are all VERY
  455.     welcomed, so drop me a line.  I don't mind updates to this
  456.     mod, but do request that you send me a courtesy copy of the
  457.     changes you made.
  458.  
  459.     *****************************************************************
  460.                               Subscribe to:
  461.  
  462.                     Modding with WWIV's Flying Chicken
  463.  
  464.               WWIVLink subtype 42456, Host @12456 (REQable)
  465.                WWIVNet subtype 42456, Host @2456 (REQable)
  466.                 IceNet subtype 42456, Host @2456 (REQable)
  467.  
  468.        All mods are released on this sub first.  Occasionally, they
  469.        make the mods subs, but usually much later.  Subscribe now!
  470.     *****************************************************************
  471.  
  472.                            The Flying Chicken
  473.        1@12456 (WWIVLink)  -  1@2456 (WWIVNet) - 1@2456 (IceNet)
  474.  
  475.                          THE INSANE ASYLUM BBS
  476.                     In Operation Since August, 1989
  477.  
  478.                    Running WWIV 4.22++  (Reg #21260)
  479.           SysOp: The Flying Chicken  -  CoSysOp: Dr. Doolittle
  480.                   Snarfable  -  Auto-SysOp Validation
  481.                  Callback Validation (Local calls only)
  482.                (214) 570-5950  -  USR Dual Std (v32/HST)
  483.  
  484.                           --- END OF LINE ---
  485.  
  486.